/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package post2.client;


//import java.rmi.RemoteException;
//import java.rmi.registry.LocateRegistry;
import java.util.*;
import post2.common.*;
import java.text.*;
import java.util.Date;
import javax.swing.Timer;
import java.awt.event.*;
import javax.swing.*;



public class ClientInterface extends javax.swing.JFrame 
{
    private Catalog cat; //catalog obtained from server
    private Post post;
    private DecimalFormat df;
    private Sale runningSale = null;
    private Timer t;//used for displaying and updating the date
    private String storeName;
   
    public ClientInterface(Post _post, Catalog _cat, String _storeName)
    {
        df = new DecimalFormat("0.00"); //formatting the price
        cat = _cat;
        storeName = _storeName;
        post = _post;
        t = new Timer(1000, new TimerListener());
        t.start();
        
        initComponents();  
        
    }
    
    private String[] getUPCList(){
        ArrayList<Product> products = cat.getProducts();
        String[] upcs = new String[products.size()];
        
        int i = 0;
        for(Product p : products){
            upcs[i] = p.getUPC();
            i++;
        }
        
        return upcs;
    }
    
    private javax.swing.DefaultComboBoxModel getUPCListModel(){
        return new javax.swing.DefaultComboBoxModel(getUPCList());
    }
    
    //updates the time in every 1000 milliseconds
    private class TimerListener implements ActionListener 
    {

       public void actionPerformed(ActionEvent e)
       { //Timer ticked
           Calendar cal = Calendar.getInstance();
           dateLabel.setText(""+cal.getTime());

       }

    }


    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        quantityDropDown = new javax.swing.JComboBox();
        CustomerName = new javax.swing.JLabel();
        customerField = new javax.swing.JTextField();
        upcDropDown = new javax.swing.JComboBox();
        CustomerName1 = new javax.swing.JLabel();
        CustomerName2 = new javax.swing.JLabel();
        enterButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        totalLabel = new javax.swing.JLabel();
        paymentDropDown = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        payButton = new javax.swing.JButton();
        invoiceField = new javax.swing.JScrollPane();
        invoice = new javax.swing.JTextArea();
        ccNumberField = new javax.swing.JTextField(5);
        dateLabel = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();

        jButton1.setText("jButton1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(770, 428));

        quantityDropDown.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9" }));
        quantityDropDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                quantityDropDownActionPerformed(evt);
            }
        });

        CustomerName.setText("Customer Name");

        customerField.setText("<customer>");
        customerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerFieldActionPerformed(evt);
            }
        });

        upcDropDown.setModel(getUPCListModel());
        upcDropDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                upcDropDownActionPerformed(evt);
            }
        });

        CustomerName1.setText("UPC");

        CustomerName2.setText("Quantity");

        enterButton.setText("ENTER");
        enterButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enterButtonActionPerformed(evt);
            }
        });

        jLabel1.setText("Product");

        jLabel2.setText("Invoice");

        jLabel3.setText("ITEM");

        jLabel4.setText("QTY");

        jLabel6.setText("unit_price");

        jLabel7.setText("extended_price");

        jLabel8.setText("TOTAL");

        totalLabel.setText("$0.00");

        paymentDropDown.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cash", "Check", "Credit" }));
        paymentDropDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                paymentDropDownActionPerformed(evt);
            }
        });

        jLabel5.setText("Payment type");

        jLabel10.setText("Payment");

        payButton.setText("Pay");
        payButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                payButtonActionPerformed(evt);
            }
        });

        invoice.setEditable(false);
        invoice.setColumns(20);
        invoice.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        invoice.setRows(5);
        invoiceField.setViewportView(invoice);

        ccNumberField.setText("Card #");
        ccNumberField.setEnabled(false);
        ccNumberField.setMinimumSize(new java.awt.Dimension(55, 28));

        dateLabel.setText("date");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addComponent(CustomerName, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(customerField, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(CustomerName1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(22, 22, 22)
                        .addComponent(upcDropDown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(CustomerName2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(quantityDropDown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(44, 44, 44))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(enterButton)
                        .addGap(139, 139, 139))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 776, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(318, 318, 318)
                                .addComponent(jLabel4)
                                .addGap(81, 81, 81)
                                .addComponent(jLabel6)
                                .addGap(64, 64, 64)
                                .addComponent(jLabel7)
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(dateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(paymentDropDown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(78, 78, 78)
                        .addComponent(totalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(ccNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(payButton)))
                .addGap(34, 34, 34))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(invoiceField)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(quantityDropDown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CustomerName, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(customerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(upcDropDown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CustomerName1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CustomerName2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(enterButton)
                .addGap(2, 2, 2)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(invoiceField, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(totalLabel)
                            .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(payButton)
                                .addComponent(ccNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(paymentDropDown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(dateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(31, 31, 31))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void customerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_customerFieldActionPerformed

    private void quantityDropDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_quantityDropDownActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_quantityDropDownActionPerformed

    private void upcDropDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_upcDropDownActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_upcDropDownActionPerformed

    private void enterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterButtonActionPerformed
        // read from dropdown
        //read price,name add to text field
        String upc = (String)upcDropDown.getSelectedItem(); //upc number from dropdown
        Product p = cat.fetchProductByUPC(upc);
        String productName = p.getName();
        double productPrice = p.getPrice();
        int quantity = Integer.parseInt((String)quantityDropDown.getSelectedItem());
        double ex_price = quantity * productPrice;
        
            
        String line = createLine(productName, quantity, productPrice, ex_price);
        invoice.append(line);
        invoice.append("\n");
        
        if(runningSale == null){
            runningSale = new Sale();
        }
        
        PurchaseItem pi = new PurchaseItem(upc, quantity);
        pi.setSubtotal(ex_price);
        runningSale.registerItem(pi);
        
        totalLabel.setText("$" + df.format(runningSale.getCurrentTotal()));
        
    }//GEN-LAST:event_enterButtonActionPerformed

    private void payButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_payButtonActionPerformed
        if(runningSale == null){
            return; //nothing to buy
        }
        
        String customerName = customerField.getText();
        String[] nameElems = customerName.split("\\s+");
        Customer customer;
        if(nameElems.length > 1){
             customer = new Customer(nameElems[0], nameElems[1]);
        }else{
             customer = new Customer(customerName, "");
        }
        
        runningSale.setCustomer(customer);
        
        //register payment
        Payment p = null;
        switch(paymentDropDown.getSelectedIndex()){
            case 0: //cash
                p = new CashPayment(runningSale.getCurrentTotal());
                break;
            case 1:
                p = new CheckPayment(runningSale.getCurrentTotal());
                break;
            case 2:
                String ccNumber = ccNumberField.getText();
                if(ccNumber == null || ccNumber.isEmpty() || ccNumber.equals("Card #"))
                {
                    System.out.println("Bad card number");
                    JOptionPane.showMessageDialog(null, "Invalid Car Number!");
                }else{
                    p = new CreditCardPayment(runningSale.getCurrentTotal(), ccNumber);
                }
                break;
            default:
                System.out.println("Unknown payment type");
                JOptionPane.showMessageDialog(null, "Unknown payment type!");
                break;
        }
        
        if(p != null){
            runningSale.setPayment(p);
            if(post.applySale(runningSale))
            {
                //GENERATE INVOIce
                
                JOptionPane.showMessageDialog(null, runningSale.printReceipt(storeName, cat));
                clearScreen();
            }else{
                System.out.println("cannot process sale");
                JOptionPane.showMessageDialog(null, "Can not process sale");
            }
        }else{
            System.out.println("cannot generate payment");
            JOptionPane.showMessageDialog(null, "cannot generate payment");
        }
        
        
    }//GEN-LAST:event_payButtonActionPerformed

    private void paymentDropDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_paymentDropDownActionPerformed
        // TODO add your handling code here:
        switch(paymentDropDown.getSelectedIndex()){
            case 0:
            case 1:
                ccNumberField.setEnabled(false);
                break;
            case 2:
                ccNumberField.setEnabled(true);
                break;
            default:
                break;
        }
    }//GEN-LAST:event_paymentDropDownActionPerformed

    private void clearScreen(){
        invoice.setText("");
        customerField.setText("<customer>");
        upcDropDown.setSelectedIndex(0);
        quantityDropDown.setSelectedIndex(0);
        paymentDropDown.setSelectedIndex(0);
        totalLabel.setText("$0.00");
        ccNumberField.setText("Card #");
        ccNumberField.setEnabled(false);
        runningSale = null;
    }
 
    //returns a line with appropriate positioning
    public String createLine(String product, int quantity, double price, double ex_price)
    {
       String newLine;
       String s_price = df.format(price);
       String s_ex_price = df.format(ex_price);
       String s_quantity = Integer.toString(quantity);
       
       char[] line = new char[200];
       //initialize line with empty space
       for(int i=0; i < line.length; i++) {
           line[i]= ' ';
       }
       
       //insert productname
       for(int i=0; i<product.length(); i++){
           line[i] = product.charAt(i);
       }
       
       //insert quantity
       for(int i=0; i<s_quantity.length(); i++){    
           line[i+42] = s_quantity.charAt(i);
       }
       
       for(int i=0; i<s_price.length(); i++){   
           line[i+55] = s_price.charAt(i);
       }
       
       for(int i=0; i<s_ex_price.length(); i++){    
           line[i+70] = s_ex_price.charAt(i);
       }
         
       newLine = new String(line);
             
       return newLine; 
    }        
    /**
     * @param args the command line arguments
     */
    public static void launch(final Post _post, final Catalog _cat, final String _storeName) 
    {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ClientInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ClientInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ClientInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ClientInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new ClientInterface(_post, _cat, _storeName).setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel CustomerName;
    private javax.swing.JLabel CustomerName1;
    private javax.swing.JLabel CustomerName2;
    private javax.swing.JTextField ccNumberField;
    private javax.swing.JTextField customerField;
    private javax.swing.JLabel dateLabel;
    private javax.swing.JButton enterButton;
    private javax.swing.JTextArea invoice;
    private javax.swing.JScrollPane invoiceField;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JButton payButton;
    private javax.swing.JComboBox paymentDropDown;
    private javax.swing.JComboBox quantityDropDown;
    private javax.swing.JLabel totalLabel;
    private javax.swing.JComboBox upcDropDown;
    // End of variables declaration//GEN-END:variables
}
